//引入全局组件
import Pagination from './Pagination/index.vue'
import SvgIcon from './SvgIcon/index.vue'
//引入全部的icon组件
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

//全局对象
const allGlobalComponent = { Pagination, SvgIcon }

// console.log(allGlobalComponent);z

// 注册全局组件
// Object.keys({})

//对外暴露插件对象
export default {
  //一定要叫这个名字
  install(app) {
    // console.log(app)

    Object.keys(allGlobalComponent).forEach((key) => {
      //注册为全局组件
      app.component(key, allGlobalComponent[key])
    })

    //icon全局组件注入
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }
  },
}
